home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.0 / PInterfaces / AppleTalk.p < prev    next >
Encoding:
Text File  |  1995-04-18  |  26.8 KB  |  792 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleTalk.p
  3.  
  4.      Contains:    AppleTalk Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT AppleTalk;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __APPLETALK__}
  30. {$SETC __APPLETALK__ := 1}
  31.  
  32. {$I+}
  33. {$SETC AppleTalkIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __OSUTILS__}
  43. {$I OSUtils.p}
  44. {$ENDC}
  45. {    MixedMode.p                                                    }
  46. {    Memory.p                                                    }
  47.  
  48. {$PUSH}
  49. {$ALIGN MAC68K}
  50. {$LibExport+}
  51.  
  52. CONST
  53. { Driver unit and reference numbers (ADSP is dynamic) }
  54.     mppUnitNum                    = 9;                            { MPP unit number }
  55.     atpUnitNum                    = 10;                            { ATP unit number }
  56.     xppUnitNum                    = 40;                            { XPP unit number }
  57.     mppRefNum                    = -10;                            { MPP reference number }
  58.     atpRefNum                    = -11;                            { ATP reference number }
  59.     xppRefNum                    = -41;                            { XPP reference number }
  60. { .MPP csCodes }
  61.     lookupReply                    = 242;                            { This command queued to ourself }
  62.     writeLAP                    = 243;                            { Write out LAP packet }
  63.     detachPH                    = 244;                            { Detach LAP protocol handler }
  64.     attachPH                    = 245;                            { Attach LAP protocol handler }
  65.     writeDDP                    = 246;                            { Write out DDP packet }
  66.     closeSkt                    = 247;                            { Close DDP socket }
  67.     openSkt                        = 248;                            { Open DDP socket }
  68.     loadNBP                        = 249;                            { Load NBP command-executing code }
  69.     lastResident                = 249;                            { Last resident command }
  70.     confirmName                    = 250;                            { Confirm name }
  71.     lookupName                    = 251;                            { Look up name on internet }
  72.     removeName                    = 252;                            { Remove name from Names Table }
  73.     registerName                = 253;                            { Register name in Names Table }
  74.     killNBP                        = 254;                            { Kill outstanding NBP request }
  75.  
  76.     unloadNBP                    = 255;                            { Unload NBP command code }
  77.     setSelfSend                    = 256;                            { MPP: Set to allow writes to self }
  78.     SetMyZone                    = 257;                            { Set my zone name }
  79.     GetATalkInfo                = 258;                            { get AppleTalk information }
  80.     ATalkClosePrep                = 259;                            { AppleTalk close query }
  81. { .ATP csCodes }
  82.     nSendRequest                = 248;                            { NSendRequest code }
  83.     relRspCB                    = 249;                            { Release RspCB }
  84.     closeATPSkt                    = 250;                            { Close ATP socket }
  85.     addResponse                    = 251;                            { Add response code | Require open skt }
  86.     sendResponse                = 252;                            { Send response code }
  87.     getRequest                    = 253;                            { Get request code }
  88.     openATPSkt                    = 254;                            { Open ATP socket }
  89.     sendRequest                    = 255;                            { Send request code }
  90.     relTCB                        = 256;                            { Release TCB }
  91.     killGetReq                    = 257;                            { Kill GetRequest }
  92.     killSendReq                    = 258;                            { Kill SendRequest }
  93.     killAllGetReq                = 259;                            { Kill all getRequests for a skt }
  94. { .XPP csCodes }
  95.     openSess                    = 255;                            { Open session }
  96.     closeSess                    = 254;                            { Close session }
  97.     userCommand                    = 253;                            { User command }
  98.  
  99.     userWrite                    = 252;                            { User write }
  100.     getStatus                    = 251;                            { Get status }
  101.     afpCall                        = 250;                            { AFP command (buffer has command code) }
  102.     getParms                    = 249;                            { Get parameters }
  103.     abortOS                        = 248;                            { Abort open session request }
  104.     closeAll                    = 247;                            { Close all open sessions }
  105.     xCall                        = 246;                            { .XPP extended calls }
  106. { Transition Queue transition types }
  107.     ATTransOpen                    = 0;                            {AppleTalk has opened}
  108.     ATTransClose                = 2;                            {AppleTalk is about to close}
  109.     ATTransClosePrep            = 3;                            {Is it OK to close AppleTalk ?}
  110.     ATTransCancelClose            = 4;                            {Cancel the ClosePrep transition}
  111.     afpByteRangeLock            = 1;                            {AFPCall command codes}
  112.     afpVolClose                    = 2;                            {AFPCall command codes}
  113.     afpDirClose                    = 3;                            {AFPCall command codes}
  114.     afpForkClose                = 4;                            {AFPCall command codes}
  115.     afpCopyFile                    = 5;                            {AFPCall command codes}
  116.     afpDirCreate                = 6;                            {AFPCall command codes}
  117.     afpFileCreate                = 7;                            {AFPCall command codes}
  118.     afpDelete                    = 8;                            {AFPCall command codes}
  119.     afpEnumerate                = 9;                            {AFPCall command codes}
  120.  
  121.     afpFlush                    = 10;                            {AFPCall command codes}
  122.     afpForkFlush                = 11;                            {AFPCall command codes}
  123.     afpGetDirParms                = 12;                            {AFPCall command codes}
  124.     afpGetFileParms                = 13;                            {AFPCall command codes}
  125.     afpGetForkParms                = 14;                            {AFPCall command codes}
  126.     afpGetSInfo                    = 15;                            {AFPCall command codes}
  127.     afpGetSParms                = 16;                            {AFPCall command codes}
  128.     afpGetVolParms                = 17;                            {AFPCall command codes}
  129.     afpLogin                    = 18;                            {AFPCall command codes}
  130.     afpContLogin                = 19;                            {AFPCall command codes}
  131.     afpLogout                    = 20;                            {AFPCall command codes}
  132.     afpMapID                    = 21;                            {AFPCall command codes}
  133.     afpMapName                    = 22;                            {AFPCall command codes}
  134.     afpMove                        = 23;                            {AFPCall command codes}
  135.     afpOpenVol                    = 24;                            {AFPCall command codes}
  136.     afpOpenDir                    = 25;                            {AFPCall command codes}
  137.     afpOpenFork                    = 26;                            {AFPCall command codes}
  138.     afpRead                        = 27;                            {AFPCall command codes}
  139.     afpRename                    = 28;                            {AFPCall command codes}
  140.     afpSetDirParms                = 29;                            {AFPCall command codes}
  141.  
  142.     afpSetFileParms                = 30;                            {AFPCall command codes}
  143.     afpSetForkParms                = 31;                            {AFPCall command codes}
  144.     afpSetVolParms                = 32;                            {AFPCall command codes}
  145.     afpWrite                    = 33;                            {AFPCall command codes}
  146.     afpGetFlDrParms                = 34;                            {AFPCall command codes}
  147.     afpSetFlDrParms                = 35;                            {AFPCall command codes}
  148.     afpDTOpen                    = 48;                            {AFPCall command codes}
  149.     afpDTClose                    = 49;                            {AFPCall command codes}
  150.     afpGetIcon                    = 51;                            {AFPCall command codes}
  151.     afpGtIcnInfo                = 52;                            {AFPCall command codes}
  152.     afpAddAPPL                    = 53;                            {AFPCall command codes}
  153.     afpRmvAPPL                    = 54;                            {AFPCall command codes}
  154.     afpGetAPPL                    = 55;                            {AFPCall command codes}
  155.     afpAddCmt                    = 56;                            {AFPCall command codes}
  156.     afpRmvCmt                    = 57;                            {AFPCall command codes}
  157.     afpGetCmt                    = 58;                            {AFPCall command codes}
  158.     afpAddIcon                    = 192;                            {Special code for ASP Write commands}
  159.     xppLoadedBit                = 5;                            { XPP bit in PortBUse }
  160.     scbMemSize                    = 192;                            { Size of memory for SCB }
  161.     xppFlagClr                    = 0;                            { Cs for AFPCommandBlock }
  162.  
  163.     xppFlagSet                    = 128;                            { StartEndFlag & NewLineFlag fields. }
  164.     lapSize                        = 20;
  165.     ddpSize                        = 26;
  166.     nbpSize                        = 26;
  167.     atpSize                        = 56;
  168.     atpXOvalue                    = 32;                            {ATP exactly-once bit }
  169.     atpEOMvalue                    = 16;                            {ATP End-Of-Message bit }
  170.     atpSTSvalue                    = 8;                            {ATP Send-Transmission-Status bit }
  171.     atpTIDValidvalue            = 2;                            {ATP trans. ID valid bit }
  172.     atpSendChkvalue                = 1;                            {ATP send checksum bit }
  173.     zipGetLocalZones            = 5;
  174.     zipGetZoneList                = 6;
  175.     zipGetMyZone                = 7;
  176.     LAPMgrPtr                    = $B18;                            {Entry point for LAP Manager}
  177.     LAPMgrCall                    = 2;                            {Offset to LAP routines}
  178.     LAddAEQ                        = 23;                            {LAPAddATQ routine selector}
  179.     LRmvAEQ                        = 24;                            {LAPRmvATQ routine selector}
  180.  
  181.     tLAPRead                    = 0;
  182.     tLAPWrite                    = 1;
  183.     tDDPRead                    = 2;
  184.     tDDPWrite                    = 3;
  185.     tNBPLookup                    = 4;
  186.     tNBPConfirm                    = 5;
  187.     tNBPRegister                = 6;
  188.     tATPSndRequest                = 7;
  189.     tATPGetRequest                = 8;
  190.     tATPSdRsp                    = 9;
  191.     tATPAddRsp                    = 10;
  192.     tATPRequest                    = 11;
  193.     tATPResponse                = 12;
  194.  
  195.     
  196. TYPE
  197.     ABCallType = SInt8;
  198.  
  199.  
  200. CONST
  201.     lapProto                    = 0;
  202.     ddpProto                    = 1;
  203.     nbpProto                    = 2;
  204.     atpProto                    = 3;
  205.  
  206.     
  207. TYPE
  208.     ABProtoType = UInt8;
  209.  
  210.     ABByte = Byte;
  211.  
  212.     LAPAdrBlock = PACKED RECORD
  213.         dstNodeID:                UInt8;
  214.         srcNodeID:                UInt8;
  215.         lapProtType:            ABByte;
  216.         filler:                    UInt8;                                    {    Filler for proper byte alignment}
  217.     END;
  218.  
  219.     ATQEntryPtr = ^ATQEntry;
  220.  
  221.     ATalkTransitionEventProcPtr = ProcPtr;  { FUNCTION ATalkTransitionEvent(eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr): LONGINT; }
  222.     ATalkTransitionEventUPP = UniversalProcPtr;
  223.  
  224.     ATalkTransitionEvent = ATalkTransitionEventUPP;
  225.  
  226.     ATQEntry = RECORD
  227.         qLink:                    ^ATQEntry;                                {next queue entry}
  228.         qType:                    INTEGER;                                {queue type}
  229.         CallAddr:                ATalkTransitionEventUPP;                {your routine descriptor}
  230.     END;
  231.  
  232.     AddrBlock = RECORD
  233.         aNet:                    UInt16;
  234.         aNode:                    SInt8; (* UInt8 *)
  235.         aSocket:                SInt8; (* UInt8 *)
  236.     END;
  237.  
  238. { Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No
  239. offests for Asm since each String address must be calculated by adding length byte to last string ptr.
  240. In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte unless they are 
  241. only a byte long. So this will generate correct looking interfaces for Pascal and C, but they will not
  242. be the same, which is OK since they are not used. }
  243.     EntityName = RECORD
  244.         objStr:                    Str32;
  245.         pad1:                    SInt8;                                    {Str32's aligned on even word boundries.}
  246.         typeStr:                Str32;
  247.         pad2:                    SInt8;
  248.         zoneStr:                Str32;
  249.         pad3:                    SInt8;
  250.     END;
  251.  
  252.     EntityPtr = ^EntityName;
  253.  
  254.     RetransType = PACKED RECORD
  255.         retransInterval:        UInt8;
  256.         retransCount:            UInt8;
  257.     END;
  258.  
  259.     BDSElement = RECORD
  260.         buffSize:                INTEGER;
  261.         buffPtr:                Ptr;
  262.         dataSize:                INTEGER;
  263.         userBytes:                LONGINT;
  264.     END;
  265.  
  266.     BDSType = ARRAY [0..7] OF BDSElement;
  267.  
  268.     BDSPtr = ^BDSElement;
  269.  
  270.     BitMapType = PACKED ARRAY [0..7] OF BOOLEAN;
  271.  
  272.     ATLAPRec = RECORD
  273.         abOpcode:                ABCallType;
  274.         filler:                    SInt8;                                    {    Filler for proper byte alignment}
  275.         abResult:                INTEGER;
  276.         abUserReference:        LONGINT;
  277.         lapAddress:                LAPAdrBlock;
  278.         lapReqCount:            INTEGER;
  279.         lapActCount:            INTEGER;
  280.         lapDataPtr:                Ptr;
  281.     END;
  282.  
  283.     ATLAPRecPtr = ^ATLAPRec;
  284.     ATLAPRecHandle = ^ATLAPRecPtr;
  285.  
  286.     ATDDPRec = RECORD
  287.         abOpcode:                ABCallType;
  288.         filler:                    SInt8;                                    {    Filler for proper byte alignment}
  289.         abResult:                INTEGER;
  290.         abUserReference:        LONGINT;
  291.         ddpType:                INTEGER;
  292.         ddpSocket:                INTEGER;
  293.         ddpAddress:                AddrBlock;
  294.         ddpReqCount:            INTEGER;
  295.         ddpActCount:            INTEGER;
  296.         ddpDataPtr:                Ptr;
  297.         ddpNodeID:                INTEGER;
  298.     END;
  299.  
  300.     ATDDPRecPtr = ^ATDDPRec;
  301.     ATDDPRecHandle = ^ATDDPRecPtr;
  302.  
  303.     ATNBPRec = RECORD
  304.         abOpcode:                ABCallType;
  305.         filler:                    SInt8;                                    {    Filler for proper byte alignment}
  306.         abResult:                INTEGER;
  307.         abUserReference:        LONGINT;
  308.         nbpEntityPtr:            EntityPtr;
  309.         nbpBufPtr:                Ptr;
  310.         nbpBufSize:                INTEGER;
  311.         nbpDataField:            INTEGER;
  312.         nbpAddress:                AddrBlock;
  313.         nbpRetransmitInfo:        RetransType;
  314.     END;
  315.  
  316.     ATNBPRecPtr = ^ATNBPRec;
  317.     ATNBPRecHandle = ^ATNBPRecPtr;
  318.  
  319.     ATATPRec = RECORD
  320.         abOpcode:                ABCallType;
  321.         filler1:                SInt8;                                    {    Filler for proper byte alignment}
  322.         abResult:                INTEGER;
  323.         abUserReference:        LONGINT;
  324.         atpSocket:                INTEGER;
  325.         atpAddress:                AddrBlock;
  326.         atpReqCount:            INTEGER;
  327.         atpDataPtr:                Ptr;
  328.         atpRspBDSPtr:            BDSPtr;
  329.         atpBitMap:                BitMapType;
  330.         filler2:                SInt8; (* UInt8 *)                        {    Filler for proper byte alignment}
  331.         atpTransID:                INTEGER;
  332.         atpActCount:            INTEGER;
  333.         atpUserData:            LONGINT;
  334.         atpXO:                    BOOLEAN;
  335.         atpEOM:                    BOOLEAN;
  336.         atpTimeOut:                INTEGER;
  337.         atpRetries:                INTEGER;
  338.         atpNumBufs:                INTEGER;
  339.         atpNumRsp:                INTEGER;
  340.         atpBDSSize:                INTEGER;
  341.         atpRspUData:            LONGINT;
  342.         atpRspBuf:                Ptr;
  343.         atpRspSize:                INTEGER;
  344.     END;
  345.  
  346.     ATATPRecPtr = ^ATATPRec;
  347.     ATATPRecHandle = ^ATATPRecPtr;
  348.  
  349.     AFPCommandBlock = PACKED RECORD
  350.         cmdByte:                UInt8;
  351.         startEndFlag:            UInt8;
  352.         forkRefNum:                INTEGER;
  353.         rwOffset:                LONGINT;
  354.         reqCount:                LONGINT;
  355.         newLineFlag:            UInt8;
  356.         newLineChar:            CHAR;
  357.     END;
  358.  
  359.     MPPPBPtr = ^MPPParamBlock;
  360.  
  361.     ATPPBPtr = ^ATPParamBlock;
  362.  
  363.     XPPParmBlkPtr = ^XPPParamBlock;
  364.  
  365.     {
  366.         MPPCompletionProcPtr uses register based parameters on the 68k and cannot
  367.         be written in or called from a high-level language without the help of
  368.         mixed mode or assembly glue.
  369.  
  370.         In:
  371.          => thePBptr        A0.L
  372.     }
  373.     MPPCompletionProcPtr = Register68kProcPtr;  { register PROCEDURE MPPCompletion(thePBptr: MPPPBPtr); }
  374.     {
  375.         ATPCompletionProcPtr uses register based parameters on the 68k and cannot
  376.         be written in or called from a high-level language without the help of
  377.         mixed mode or assembly glue.
  378.  
  379.         In:
  380.          => thePBptr        A0.L
  381.     }
  382.     ATPCompletionProcPtr = Register68kProcPtr;  { register PROCEDURE ATPCompletion(thePBptr: ATPPBPtr); }
  383.     {
  384.         XPPCompletionProcPtr uses register based parameters on the 68k and cannot
  385.         be written in or called from a high-level language without the help of
  386.         mixed mode or assembly glue.
  387.  
  388.         In:
  389.          => thePBptr        A0.L
  390.     }
  391.     XPPCompletionProcPtr = Register68kProcPtr;  { register PROCEDURE XPPCompletion(thePBptr: XPPParmBlkPtr); }
  392.     {
  393.         AttnRoutineProcPtr uses register based parameters on the 68k and cannot
  394.         be written in or called from a high-level language without the help of
  395.         mixed mode or assembly glue.
  396.  
  397.         In:
  398.          => sessRefnum      D0.W
  399.          => attnBytes       D1.W
  400.     }
  401.     AttnRoutineProcPtr = Register68kProcPtr;  { register PROCEDURE AttnRoutine(sessRefnum: INTEGER; attnBytes: INTEGER); }
  402.     MPPCompletionUPP = UniversalProcPtr;
  403.     ATPCompletionUPP = UniversalProcPtr;
  404.     XPPCompletionUPP = UniversalProcPtr;
  405.     AttnRoutineUPP = UniversalProcPtr;
  406.  
  407.     WDSElement = RECORD
  408.         entryLength:            INTEGER;
  409.         entryPtr:                Ptr;
  410.     END;
  411.  
  412.     NTElement = RECORD
  413.         nteAddress:                AddrBlock;                                {network address of entity}
  414.         filler:                    SInt8;
  415.         entityData:                PACKED ARRAY [0..98] OF SInt8;            {Object, Type & Zone}
  416.     END;
  417.  
  418.     NamesTableEntry = RECORD
  419.         qNext:                    Ptr;                                    {ptr to next NTE}
  420.         nt:                        NTElement;
  421.     END;
  422.  
  423.     MPPProtocolHandlerProcPtr = ProcPtr;  { FUNCTION MPPProtocolHandler(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; }
  424.     DDPSocketListenerProcPtr = ProcPtr;  { FUNCTION DDPSocketListener(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; }
  425.     MPPProtocolHandlerUPP = UniversalProcPtr;
  426.     DDPSocketListenerUPP = UniversalProcPtr;
  427.  
  428.     MPPParamBlock = RECORD
  429.         qLink:                    ^QElem;
  430.         qType:                    INTEGER;
  431.         ioTrap:                    INTEGER;
  432.         ioCmdAddr:                Ptr;
  433.         ioCompletion:            ATPCompletionUPP;
  434.         ioResult:                OSErr;
  435.         userData:                LONGINT;
  436.         reqTID:                    INTEGER;
  437.         ioRefNum:                INTEGER;
  438.         csCode:                    INTEGER;
  439.         CASE INTEGER OF
  440.         0: (
  441.             filler0:                    INTEGER;
  442.             wdsPointer:                    Ptr;
  443.            );
  444.         1: (
  445.             protType:                    SInt8; (* UInt8 *)
  446.             filler:                        SInt8; (* UInt8 *)
  447.             handler:                    MPPProtocolHandlerUPP;
  448.            );
  449.         2: (
  450.             socket:                        SInt8; (* UInt8 *)
  451.             checksumFlag:                SInt8; (* UInt8 *)
  452.             listener:                    DDPSocketListenerUPP;
  453.            );
  454.         3: (
  455.             interval:                    SInt8; (* UInt8 *)                    {retry interval }
  456.             count:                        SInt8; (* UInt8 *)                    {retry count }
  457.             nbpPtrs:                    Ptr;
  458.             CASE INTEGER OF
  459.             0: (
  460.                 verifyFlag:                        SInt8; (* UInt8 *)
  461.                 filler3:                        SInt8; (* UInt8 *)
  462.                );
  463.             1: (
  464.                 retBuffPtr:                        Ptr;
  465.                 retBuffSize:                    INTEGER;
  466.                 maxToGet:                        INTEGER;
  467.                 numGotten:                        INTEGER;
  468.                );
  469.             2: (
  470.                 confirmAddr:                    AddrBlock;
  471.                 newSocket:                        SInt8; (* UInt8 *)
  472.                 filler4:                        SInt8; (* UInt8 *)
  473.                );
  474.            );
  475.         4: (
  476.             newSelfFlag:                SInt8; (* UInt8 *)                    {self-send toggle flag }
  477.             oldSelfFlag:                SInt8; (* UInt8 *)                    {previous self-send state }
  478.            );
  479.         5: (
  480.             nKillQEl:                    Ptr;                                {ptr to i/o queue element to cancel }
  481.            );
  482.         6: (
  483.             version:                    INTEGER;
  484.             varsPtr:                    Ptr;
  485.             DCEPtr:                        Ptr;
  486.             portID:                        INTEGER;
  487.             configuration:                LONGINT;
  488.             selfSend:                    INTEGER;
  489.             netLo:                        INTEGER;
  490.             netHi:                        INTEGER;
  491.             ourAdd:                        LONGINT;
  492.             routerAddr:                    LONGINT;
  493.             numOfPHs:                    INTEGER;
  494.             numOfSkts:                    INTEGER;
  495.             numNBPEs:                    INTEGER;
  496.             nTQueue:                    Ptr;
  497.             LAlength:                    INTEGER;
  498.             linkAddr:                    Ptr;
  499.             zoneName:                    Ptr;
  500.            );
  501.         7: (
  502.             appName:                    Ptr;                                {pointer to application name in buffer}
  503.            );
  504.     END;
  505.  
  506.     XPPParamBlock = RECORD
  507.         qLink:                    ^QElem;
  508.         qType:                    INTEGER;
  509.         ioTrap:                    INTEGER;
  510.         ioCmdAddr:                Ptr;
  511.         ioCompletion:            XPPCompletionUPP;
  512.         ioResult:                OSErr;
  513.         cmdResult:                LONGINT;
  514.         ioVRefNum:                INTEGER;
  515.         ioRefNum:                INTEGER;
  516.         csCode:                    INTEGER;
  517.         CASE INTEGER OF
  518.         0: (
  519.             abortSCBPtr:                Ptr;                                { SCB pointer for AbortOS}
  520.            );
  521.         1: (
  522.             aspMaxCmdSize:                INTEGER;
  523.             aspQuantumSize:                INTEGER;
  524.             numSesss:                    INTEGER;
  525.            );
  526.         2: (
  527.             sessRefnum:                    INTEGER;
  528.             aspTimeout:                    SInt8; (* UInt8 *)
  529.             aspRetry:                    SInt8; (* UInt8 *)
  530.             CASE INTEGER OF
  531.             0: (
  532.                 serverAddr:                        AddrBlock;
  533.                 scbPointer:                        Ptr;
  534.                 attnRoutine:                    AttnRoutineUPP;
  535.                );
  536.             1: (
  537.                 cbSize:                            INTEGER;
  538.                 cbPtr:                            Ptr;
  539.                 rbSize:                            INTEGER;
  540.                 rbPtr:                            Ptr;
  541.                 CASE INTEGER OF
  542.                 0: (
  543.                     afpAddrBlock:                        AddrBlock;
  544.                     afpSCBPtr:                            Ptr;
  545.                     afpAttnRoutine:                        Ptr;
  546.                    );
  547.                 1: (
  548.                     wdSize:                                INTEGER;
  549.                     wdPtr:                                Ptr;
  550.                     ccbStart:                            ARRAY [0..295] OF SInt8; (* UInt8 *)
  551.                    );
  552.                );
  553.            );
  554.         3: (
  555.             xppSubCode:                    INTEGER;
  556.             xppTimeout:                    SInt8; (* UInt8 *)
  557.             xppRetry:                    SInt8; (* UInt8 *)
  558.             filler1:                    INTEGER;
  559.             zipBuffPtr:                    Ptr;
  560.             zipNumZones:                INTEGER;
  561.             zipLastFlag:                SInt8; (* UInt8 *)
  562.             filler2:                    SInt8; (* UInt8 *)
  563.             zipInfoField:                PACKED ARRAY [0..69] OF SInt8; (* UInt8 *)
  564.            );
  565.     END;
  566.  
  567.     ATPParamBlock = RECORD
  568.         qLink:                    ^QElem;
  569.         qType:                    INTEGER;
  570.         ioTrap:                    INTEGER;
  571.         ioCmdAddr:                Ptr;
  572.         ioCompletion:            ATPCompletionUPP;
  573.         ioResult:                OSErr;
  574.         userData:                LONGINT;
  575.         reqTID:                    INTEGER;
  576.         ioRefNum:                INTEGER;
  577.         csCode:                    INTEGER;
  578.         atpSocket:                SInt8; (* UInt8 *)
  579.         atpFlags:                SInt8; (* UInt8 *)
  580.         addrBlock:                AddrBlock;
  581.         reqLength:                INTEGER;
  582.         reqPointer:                Ptr;
  583.         bdsPointer:                Ptr;
  584.         CASE INTEGER OF
  585.         0: (
  586.             numOfBuffs:                    SInt8; (* UInt8 *)
  587.             timeOutVal:                    SInt8; (* UInt8 *)
  588.             numOfResps:                    SInt8; (* UInt8 *)
  589.             retryCount:                    SInt8; (* UInt8 *)
  590.             intBuff:                    INTEGER;
  591.             TRelTime:                    SInt8; (* UInt8 *)
  592.            );
  593.         1: (
  594.             filler:                        SInt8; (* UInt8 *)
  595.             bdsSize:                    SInt8; (* UInt8 *)
  596.             transID:                    INTEGER;
  597.            );
  598.         2: (
  599.             bitMap:                        SInt8; (* UInt8 *)
  600.             filler2:                    SInt8; (* UInt8 *)
  601.            );
  602.         3: (
  603.             rspNum:                        SInt8; (* UInt8 *)
  604.             filler3:                    SInt8; (* UInt8 *)
  605.            );
  606.         4: (
  607.             aKillQEl:                    Ptr;
  608.            );
  609.     END;
  610.  
  611.  
  612. CONST
  613.     uppATalkTransitionEventProcInfo = $00000FF1; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 4 byte result; }
  614.     uppMPPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  615.     uppATPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  616.     uppXPPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  617.     uppAttnRoutineProcInfo = $00061002; { Register PROCEDURE (2 bytes in D0, 2 bytes in D1); }
  618.     uppMPPProtocolHandlerProcInfo = $0000007F; { SPECIAL_CASE_PROCINFO( kSpecialCaseProtocolHandler ) }
  619.     uppDDPSocketListenerProcInfo = $0000008F; { SPECIAL_CASE_PROCINFO( kSpecialCaseSocketListener ) }
  620.  
  621. FUNCTION NewATalkTransitionEventProc(userRoutine: ATalkTransitionEventProcPtr): ATalkTransitionEventUPP;
  622.     {$IFC NOT GENERATINGCFM }
  623.     INLINE $2E9F;
  624.     {$ENDC}
  625.  
  626. FUNCTION NewMPPCompletionProc(userRoutine: MPPCompletionProcPtr): MPPCompletionUPP;
  627.     {$IFC NOT GENERATINGCFM }
  628.     INLINE $2E9F;
  629.     {$ENDC}
  630.  
  631. FUNCTION NewATPCompletionProc(userRoutine: ATPCompletionProcPtr): ATPCompletionUPP;
  632.     {$IFC NOT GENERATINGCFM }
  633.     INLINE $2E9F;
  634.     {$ENDC}
  635.  
  636. FUNCTION NewXPPCompletionProc(userRoutine: XPPCompletionProcPtr): XPPCompletionUPP;
  637.     {$IFC NOT GENERATINGCFM }
  638.     INLINE $2E9F;
  639.     {$ENDC}
  640.  
  641. FUNCTION NewAttnRoutineProc(userRoutine: AttnRoutineProcPtr): AttnRoutineUPP;
  642.     {$IFC NOT GENERATINGCFM }
  643.     INLINE $2E9F;
  644.     {$ENDC}
  645.  
  646. FUNCTION NewMPPProtocolHandlerProc(userRoutine: MPPProtocolHandlerProcPtr): MPPProtocolHandlerUPP;
  647.     {$IFC NOT GENERATINGCFM }
  648.     INLINE $2E9F;
  649.     {$ENDC}
  650.  
  651. FUNCTION NewDDPSocketListenerProc(userRoutine: DDPSocketListenerProcPtr): DDPSocketListenerUPP;
  652.     {$IFC NOT GENERATINGCFM }
  653.     INLINE $2E9F;
  654.     {$ENDC}
  655.  
  656. FUNCTION CallATalkTransitionEventProc(eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr; userRoutine: ATalkTransitionEventUPP): LONGINT;
  657.     {$IFC NOT GENERATINGCFM}
  658.     INLINE $205F, $4E90;
  659.     {$ENDC}
  660.  
  661. PROCEDURE CallMPPCompletionProc(thePBptr: MPPPBPtr; userRoutine: MPPCompletionUPP);
  662.     {$IFC NOT GENERATINGCFM}
  663.     {To be implemented:  Glue to move parameters into registers.}
  664.     {$ENDC}
  665.  
  666. PROCEDURE CallATPCompletionProc(thePBptr: ATPPBPtr; userRoutine: ATPCompletionUPP);
  667.     {$IFC NOT GENERATINGCFM}
  668.     {To be implemented:  Glue to move parameters into registers.}
  669.     {$ENDC}
  670.  
  671. PROCEDURE CallXPPCompletionProc(thePBptr: XPPParmBlkPtr; userRoutine: XPPCompletionUPP);
  672.     {$IFC NOT GENERATINGCFM}
  673.     {To be implemented:  Glue to move parameters into registers.}
  674.     {$ENDC}
  675.  
  676. PROCEDURE CallAttnRoutineProc(sessRefnum: INTEGER; attnBytes: INTEGER; userRoutine: AttnRoutineUPP);
  677.     {$IFC NOT GENERATINGCFM}
  678.     {To be implemented:  Glue to move parameters into registers.}
  679.     {$ENDC}
  680.  
  681. FUNCTION CallMPPProtocolHandlerProc(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER; userRoutine: MPPProtocolHandlerUPP): BOOLEAN;
  682.     {$IFC NOT GENERATINGCFM}
  683.     {To be implemented:  Glue to move parameters according to special case conventions.}
  684.     {$ENDC}
  685.  
  686. FUNCTION CallDDPSocketListenerProc(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER; userRoutine: DDPSocketListenerUPP): BOOLEAN;
  687.     {$IFC NOT GENERATINGCFM}
  688.     {To be implemented:  Glue to move parameters according to special case conventions.}
  689.     {$ENDC}
  690.  
  691. FUNCTION OpenXPP(VAR xppRefnum: INTEGER): OSErr;
  692. FUNCTION ASPOpenSession(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  693. FUNCTION ASPCloseSession(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  694. FUNCTION ASPAbortOS(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  695. FUNCTION ASPGetParms(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  696. FUNCTION ASPCloseAll(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  697. FUNCTION ASPUserWrite(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  698. FUNCTION ASPUserCommand(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  699. FUNCTION ASPGetStatus(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  700. FUNCTION AFPCommand(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  701. FUNCTION GetLocalZones(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  702. FUNCTION GetZoneList(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  703. FUNCTION GetMyZone(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  704. FUNCTION PAttachPH(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  705. FUNCTION PDetachPH(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  706. FUNCTION PWriteLAP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  707. FUNCTION POpenSkt(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  708. FUNCTION PCloseSkt(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  709. FUNCTION PWriteDDP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  710. FUNCTION PRegisterName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  711. FUNCTION PLookupName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  712. FUNCTION PConfirmName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  713. FUNCTION PRemoveName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  714. FUNCTION PSetSelfSend(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  715. FUNCTION PKillNBP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  716. FUNCTION PGetAppleTalkInfo(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  717. FUNCTION PATalkClosePrep(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  718. FUNCTION POpenATPSkt(thePBptr: ATPPBPtr; async: BOOLEAN): OSErr;
  719. FUNCTION PCloseATPSkt(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  720. FUNCTION PSendRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  721. FUNCTION PGetRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  722. FUNCTION PSendResponse(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  723. FUNCTION PAddResponse(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  724. FUNCTION PRelTCB(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  725. FUNCTION PRelRspCB(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  726. FUNCTION PNSendRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  727. FUNCTION PKillSendReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  728. FUNCTION PKillGetReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  729. FUNCTION ATPKillAllGetReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  730. PROCEDURE BuildLAPwds(wdsPtr: Ptr; dataPtr: Ptr; destHost: INTEGER; prototype: INTEGER; frameLen: INTEGER);
  731. PROCEDURE BuildDDPwds(wdsPtr: Ptr; headerPtr: Ptr; dataPtr: Ptr; netAddr: AddrBlock; ddpType: INTEGER; dataLen: INTEGER);
  732. PROCEDURE NBPSetEntity(buffer: Ptr; nbpObject: ConstStr32Param; nbpType: ConstStr32Param; nbpZone: ConstStr32Param);
  733. PROCEDURE NBPSetNTE(ntePtr: Ptr; nbpObject: ConstStr32Param; nbpType: ConstStr32Param; nbpZone: ConstStr32Param; socket: INTEGER);
  734. FUNCTION GetBridgeAddress: INTEGER;
  735. FUNCTION BuildBDS(buffPtr: Ptr; bdsPtr: Ptr; buffSize: INTEGER): INTEGER;
  736. FUNCTION MPPOpen: OSErr;
  737. FUNCTION LAPAddATQ(theATQEntry: ATQEntryPtr): OSErr;
  738. FUNCTION LAPRmvATQ(theATQEntry: ATQEntryPtr): OSErr;
  739. FUNCTION ATPLoad: OSErr;
  740. FUNCTION ATPUnload: OSErr;
  741. FUNCTION NBPExtract(theBuffer: Ptr; numInBuf: INTEGER; whichOne: INTEGER; VAR abEntity: EntityName; VAR address: AddrBlock): OSErr;
  742. FUNCTION GetNodeAddress(VAR myNode: INTEGER; VAR myNet: INTEGER): OSErr;
  743. FUNCTION IsMPPOpen: BOOLEAN;
  744. FUNCTION IsATPOpen: BOOLEAN;
  745. PROCEDURE ATEvent(event: LONGINT; infoPtr: Ptr);
  746. FUNCTION ATPreFlightEvent(event: LONGINT; cancel: LONGINT; infoPtr: Ptr): OSErr;
  747. {
  748.     The following routines are obsolete and will not be supported on
  749.     PowerPC. Equivalent functionality is provided by the routines
  750.     above.
  751. }
  752. {$IFC OLDROUTINENAMES  & NOT GENERATINGCFM }
  753. FUNCTION MPPClose: OSErr;
  754. FUNCTION LAPOpenProtocol(theLAPType: ByteParameter; protoPtr: Ptr): OSErr;
  755. FUNCTION LAPCloseProtocol(theLAPType: ByteParameter): OSErr;
  756. FUNCTION LAPWrite(abRecord: ATLAPRecHandle; async: BOOLEAN): OSErr;
  757. FUNCTION LAPRead(abRecord: ATLAPRecHandle; async: BOOLEAN): OSErr;
  758. FUNCTION LAPRdCancel(abRecord: ATLAPRecHandle): OSErr;
  759. FUNCTION DDPOpenSocket(VAR theSocket: INTEGER; sktListener: Ptr): OSErr;
  760. FUNCTION DDPCloseSocket(theSocket: INTEGER): OSErr;
  761. FUNCTION DDPRead(abRecord: ATDDPRecHandle; retCksumErrs: BOOLEAN; async: BOOLEAN): OSErr;
  762. FUNCTION DDPWrite(abRecord: ATDDPRecHandle; doChecksum: BOOLEAN; async: BOOLEAN): OSErr;
  763. FUNCTION DDPRdCancel(abRecord: ATDDPRecHandle): OSErr;
  764. FUNCTION ATPOpenSocket(addrRcvd: AddrBlock; VAR atpSocket: INTEGER): OSErr;
  765. FUNCTION ATPCloseSocket(atpSocket: INTEGER): OSErr;
  766. FUNCTION ATPSndRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  767. FUNCTION ATPRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  768. FUNCTION ATPReqCancel(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  769. FUNCTION ATPGetRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  770. FUNCTION ATPSndRsp(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  771. FUNCTION ATPAddRsp(abRecord: ATATPRecHandle): OSErr;
  772. FUNCTION ATPResponse(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  773. FUNCTION ATPRspCancel(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  774. FUNCTION NBPRegister(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  775. FUNCTION NBPLookup(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  776. FUNCTION NBPConfirm(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  777. FUNCTION NBPRemove(abEntity: EntityPtr): OSErr;
  778. FUNCTION NBPLoad: OSErr;
  779. FUNCTION NBPUnload: OSErr;
  780. {$ENDC}
  781.  
  782. {$ALIGN RESET}
  783. {$POP}
  784.  
  785. {$SETC UsingIncludes := AppleTalkIncludes}
  786.  
  787. {$ENDC} {__APPLETALK__}
  788.  
  789. {$IFC NOT UsingIncludes}
  790.  END.
  791. {$ENDC}
  792.